<template>
  <view>
    <button @click="openCanvas">打开画板</button>
    <for-canvas ref="canvasComponent" @close="onCanvasClose"></for-canvas>
  </view>
</template>

<script>
import ForCanvas from '@/components/for-canvas/for-canvas.vue'

export default {
  components: { ForCanvas },
  methods: {
    openCanvas() {
      this.$refs.canvasComponent.open({
        imgSrc: 'https://n.sinaimg.cn/sinakd20119/115/w2048h2867/20200718/c732-iwpcxks0653574.jpg'
      })
    },
    onCanvasClose() {
      console.log('画板已关闭')
    }
  }
}
</script> 